home *** CD-ROM | disk | FTP | other *** search
- Path: soap.news.pipex.net!pipex!usenet
- From: m.hendry@dial.pipex.com (Mathew Hendry)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: simple K&R ANSI-C examples won't compile under SAS/C
- Date: Fri, 1 Mar 96 06:21:44
- Organization: Private node.
- Message-ID: <19960301.444BE0.6206@ai199.du.pipex.com>
- References: <68771782@0humpty.tomate.tng.oche.de>
- NNTP-Posting-Host: ai199.du.pipex.com
- X-Newsreader: TIN [AMIGA 1.3 950726BETA PL0]
-
- Andreas Mixich (humpty@TOMATE.TNG.OCHE.DE) wrote:
- : this little example form the 'Kernighan&Ritchie' won't compile:
- :
- : #include <stdio.h>
- : #include <clib/alib_stdio_protos.h>
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
- Remove this line - it is not necessary and will cause problems. Why did you
- include it in the first place? It is not in the original example...
-
- : main()
- : {
- : int c;
- :
- : while((c = GetChar()) !=EOF)
- : PutChar(c);
- : }
- :
- : Yes, *you* laugh now, but for me this is really strange.
- :
- : I get an error #72 in alib_stdio_protos.h; conflict with previous declaration,
- : see file stdio.h.
- :
- : Now, I have read the guide on this error, but if I leave out the
- : alib_stdio_protos.h, this will cause the error, no Prototype for function
- : getchar() (or so).
- :
- : Also, if I do a c = GetChar(void) (as synopsis description in sclib.guide
- : shows) the error still ocuures.
-
- C function names are case sensitive - replace GetChar and PutChar with getchar
- and putchar and the example will compile correctly.
-
- -- Mat.
-